<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            width: 300px;
            height: 300px;
            background-color: red;
            font-size:20px;
        }
        .box2{
            width: 200px;
            height: 200px;
            background-color: rgb(0, 187, 255);
            font-size:20px;
        }
        .box3{
            width: 100px;
            height: 100px;
            background-color: orange;
            font-size:20px;
        }
    </style>
</head>
<body>
    <div class="box1">box1
        <div class="box2">box2
            <div class="box3">box3</div>
        </div>
    </div>
    <script>
        // document.querySelector(".box1").onclick=()=>{
        //     console.log("box1");
        // }
        // document.querySelector(".box2").onclick=()=>{
        //     console.log("box2");
        // }
        // document.querySelector(".box3").onclick=()=>{
        //     console.log("box3");
        // }
        document.querySelector(".box1").addEventListener("click",()=>{
            console.log("box1");
        },true)
        document.querySelector(".box2").addEventListener("click",()=>{
            console.log("box2");
        })
        document.querySelector(".box3").addEventListener("click",()=>{
            console.log("box3");})

        
    </script>
</body>
</html>